/**
 * BBD Service Inc
 * All Rights Reserved @2018
 */
package com.bbd.merchant.guide.galaxy.core;

import com.bbd.merchant.guide.galaxy.strategy.*;

import java.util.ArrayList;
import java.util.List;

/**
 *
 *
 * @author tianyuliang
 * @version $Id: GalaxyGuider.java, v0.1 2018-08-01 14:40 tianyuliang Exp $$
 */
public class GalaxyGuider {

    private static List<ICommandStrategy> commandStrategies = new ArrayList<>();

    static {
        List<ICommandStrategy> strategies = new ArrayList<>();
        strategies.add(new AliasCommandStrategy());
        strategies.add(new UnitPriceCommandStrategy());
        strategies.add(new HowMuchCommandStrategy());
        strategies.add(new HowManyCommandStrategy());
        strategies.add(new UnknownCommandStrategy());
    }

    private static GuideResponse resolve(String content) {
        for (ICommandStrategy strategy : commandStrategies) {
            if (strategy.CanExecute(content)) {
                return strategy.Execute(content);
            }
        }
        return GuideResponse.unknown();
    }


}
